<?php
namespace Framework\Log;

use Monolog\Logger as MonologLogger;
use Monolog\Handler\StreamHandler;

class Logger {

	public $logger;

	public $suffix = '.log';

	public function __construct()
	{
        $this->logger = new MonologLogger('name');
        $handler = new StreamHandler($this->file(), MonologLogger::WARNING);
        $this->logger->pushHandler($handler);
	}


	public function file()
	{
		return $this->store() . $this->filename() . $this->suffix;
	}

	public function filename()
	{
		return date('Ymd');
	}

	public function store()
	{
		return 'D:\paita\runtime\log\\';
	}

	public function __call(string $function_name, $args)
	{
		return call_user_func_array([$this->logger, $function_name], $args);
	}
}